//
//  CXYSongsMenuDataCollectionViewCell.m
//  NewMusic
//
//  Created by chuxinyu123 on 15/11/21.
//  Copyright © 2015年 Going. All rights reserved.
//

#import "CXYSongsMenuDataCollectionViewCell.h"

@implementation CXYSongsMenuDataCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createLabel];
    }
    return self;
}

- (void)createLabel
{
    self.upView = [[UIView alloc] init];
    self.upView.backgroundColor = [UIColor whiteColor];
    self.upView.layer.masksToBounds = YES;
    self.upView.layer.cornerRadius = 5;
    self.upView.alpha = 0.3;
    self.titleLabel = [[UILabel alloc] init];
    self.titleLabel.textColor = [UIColor whiteColor];
    self.titleLabel.font = [UIFont systemFontOfSize:15];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:_upView];
    [self.contentView addSubview:_titleLabel];
    [_titleLabel release];
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    _titleLabel.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height);
    _upView.frame = CGRectMake(0, 5, self.contentView.frame.size.width, self.contentView.frame.size.height - 10);
}

- (void)setTitleString:(NSString *)titleString
{
    if (_titleString != titleString) {
        [_titleString release];
        _titleString = [titleString copy];
    }
    _titleLabel.text = titleString;
}
@end
